<%-- 
    Document   : view_documents
    Created on : May 28, 2013, 4:27:43 PM
    Author     : fikri
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" type="text/css" media="screen" />
        <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/loginstyle.css" />
        <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/prettyPhoto.css" />        
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
        <script src="${pageContext.request.contextPath}/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
        <title>Documents</title>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                $("a[rel^='prettyPhoto']").prettyPhoto({social_tools:''});
            });
        </script>
        <style>
            .validateTips { border: 1px solid transparent; padding: 0.3em; color: red; font-weight: bold}
        </style>
    </head>
    <body onunload="unblock();">
        <s:form beanclass="exatrez.stripes.action.ObservationAction" name="form1">                 
            <div id="content">
                <div id="page-title">
                    <span class="title">Documents</span>
                </div>              

                <p class="validateTips"><em>NOTE :</em>Right click the thumbnail image to save it.</p>
                <display:table class="tablecloth" name="${actionBean.observationTask.folder.documents}" requestURI="/observation?searchDraftReport" id="line">
                    <display:column title="No.">${line_rowNum}</display:column>
                    <display:column title="File Name">${line.title}</display:column>
                    <display:column title="Thumbnail">
                        <c:choose>
                            <c:when test="${line.contentType eq actionBean.forPdf}">
                                <a href="${pageContext.request.contextPath}/dokumen/view/${line.documentId}" title="${line.title}">
                                    <img src="${pageContext.request.contextPath}/images/icon/microsoft/adobe.png" width="50" height="50"/>
                                </a>
                            </c:when>
                            <c:when test="${line.contentType eq actionBean.forPdf}">
                                <a href="${pageContext.request.contextPath}/dokumen/view/${line.documentId}" title="${line.title}">
                                    <img src="${pageContext.request.contextPath}/images/icon/microsoft/adobe.png" width="50" height="50"/>
                                </a>
                            </c:when>
                            <c:when test="${line.contentType eq actionBean.forXlsx or line.contentType eq actionBean.forXls}">
                                <a href="${pageContext.request.contextPath}/dokumen/view/${line.documentId}" title="${line.title}">
                                        <img src="${pageContext.request.contextPath}/images/icon/microsoft/excel.png" width="50" height="50"/>
                                    </a>
                            </c:when>
                            <c:when test="${line.contentType eq actionBean.forDocx or line.contentType eq actionBean.forDoc}">
                                 <a href="${pageContext.request.contextPath}/dokumen/view/${line.documentId}" title="${line.title}">
                                        <img src="${pageContext.request.contextPath}/images/icon/microsoft/word.png" width="50" height="50"/>
                                    </a>
                            </c:when>
                            <c:when test="${line.contentType eq actionBean.forPptx or line.contentType eq actionBean.forPpt}">
                                <a href="${pageContext.request.contextPath}/dokumen/view/${line.documentId}" title="${line.title}">
                                        <img src="${pageContext.request.contextPath}/images/icon/microsoft/powerpoint.png" width="50" height="50"/>
                                    </a>
                            </c:when>
                             <c:when test="${line.contentType eq actionBean.forVideoMov or 
                                  line.contentType eq actionBean.forVideoMkv or 
                                  line.contentType eq actionBean.forVideoMp4 or 
                                  line.contentType eq actionBean.forVideoAvi or 
                                  line.contentType eq actionBean.forVideoMpeg or 
                                  line.contentType eq actionBean.forVideoWmv or 
                                  line.contentType eq actionBean.forVideoAsf or 
                                  line.contentType eq actionBean.forVideoFlv or 
                                  line.contentType eq actionBean.forVideoRmvb or 
                                  line.contentType eq actionBean.forVideo3gp}">
                           <a href="${pageContext.request.contextPath}/dokumen/view/${line.documentId}" title="${line.title}">
                                    <img src="${pageContext.request.contextPath}/images/icon/video/video.png" width="50" height="50"/>
                                </a>
                            </c:when>
                            <c:otherwise>
                                <a href="${pageContext.request.contextPath}/dokumen/view/${line.documentId}" rel="prettyPhoto[gallery1]" 
                                   title="${line.title}">
                                    <img src="${pageContext.request.contextPath}/dokumen/view/${line.documentId}" width="50" height="50"/>
                                </a>                                
                            </c:otherwise>
                        </c:choose> 
                    </display:column>                    
                </display:table>  
                <s:submit name="" value="CLOSE" class="btn" onclick="self.close();"/>
            </s:form>
        </div>
    </body>
</html>